#课堂练习
import pygame,sys,random
from pygame.color import THECOLORS
pygame.init()
screen=pygame.display.set_mode([640,480])
screen.fill([255,255,255])
for i in range(100):
    width=random.randint(0,250)
    height=random.randint(0,100)
    top=random.randint(0,400)
    left=random.randint(0,500)
    red=random.randint(0,255)
    green=random.randint(0,255)
    blue=random.randint(0,255)
    color=[red,green,blue]
    line_Width=random.randint(1,6)
    # pygame.draw.rect(screen,[0,0,0],[left,top,width,height],1)
    pygame.draw.rect(screen,color,[left,top,width,height],line_Width)
pygame.display.flip()

while True:
    for event in pygame.event.get():
        if event.type==pygame.QUIT:
            sys.exit()